<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>CRM</title>
    <link rel="stylesheet" type="text/css" href="/static/plugin/jquery-easyui-1.5.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/static/plugin/jquery-easyui-1.5.2/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="/static/plugin/jquery-easyui-1.5.2/demo/demo.css">
    <script type="text/javascript" src="/static/plugin/jquery-easyui-1.5.2/jquery.min.js"></script>
    <script type="text/javascript" src="/static/plugin/jquery-easyui-1.5.2/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/plugin/jquery-easyui-1.5.2/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/static/js/employee.js"></script>
</head>
<body>
<table id="emp_datagrid"></table>

<div id="emp_toolbar">
    <shiro:hasPermission name="employee:saveOrUpdate">
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'" data-cmd="add">添加</a>
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-edit'" data-cmd="edit">编辑</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="employee:status">
    <a class="easyui-linkbutton" id="btn_state" data-options="plain:true,iconCls:'icon-remove'" data-cmd="status">离职</a>
    </shiro:hasPermission>
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-clear'" data-cmd="changePwd">修改密码</a>&nbsp;
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'" data-cmd="reload">刷新</a>&nbsp;
    <span>关键字:</span><input class="easyui-textbox" prompt="请输入用户名或者电话" id="keyword">&nbsp;
    <span>入职日期:</span><input class="easyui-datebox" id="beginDate">
    <span>～</span>
    <input class="easyui-datebox" id="endDate">&nbsp;
    <span>部门:</span><input class="easyui-combobox" id="qoDept" prompt="请选择"
                           data-options="editable:false,panelHeight:'auto',valueField:'id',textField:'name',url:'/department/selectAll.do'">
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-search'" data-cmd="query"></a>

    <%--文件上传下载--%>
    <a class="easyui-linkbutton"  data-options="iconCls:'icon-search',plain:true"
       onclick="window.open('/employee/exportXls.do')">导出</a>
    <form action="/employee/importXls.do" method="post" enctype="multipart/form-data">
        <input type="file" name="file">
        <input type="submit" name="上传">
    </form>
</div>
<div id="emp_buttons" >
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-save'" data-cmd="save" data-url="saveOrUpdate" data-from="emp_form" >保存</a>
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'" data-cmd="cancel">取消</a>
</div>

<div id="emp_btn_Pwd">
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-save'" data-cmd="save" data-url="changePwd" data-from="emp_pwdForm" >保存</a>
    <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'" data-cmd="cancel">取消</a>
</div>


<div id="emp_changePwd" align="center">
    <form id="emp_pwdForm">
        <input type="hidden" name="id">
        <table style="margin-top: 20px">
            <tr style="height:40px">
                <td align="right">
                    输入密码:
                </td>
                <td>
                    <input id="pwd" class="easyui-passwordbox" name="password" data-options="required:true">
                </td>
            </tr>
            <tr style="height:40px">
                <td>
                    再次输入密码:
                </td>
                <td>
                    <input class="easyui-passwordbox" id="rpwd" data-options="required:true" validType="equals['#pwd']" >
                </td>
            </tr>
        </table>
    </form>
</div>

<div id="emp_dialog" align="center">
    <form method="post" id="emp_form">
        <input type="hidden" name="id">
        <table style="margin-top: 20px" align="center">
            <tr style="height:40px">
                <td>
                    用户名:
                </td>
                <td>
                    <input class="easyui-textbox" name="username" data-options="required:true">
                </td>
            </tr>
            <tr style="height:40px">
                <td>
                    真实姓名:
                </td>
                <td>
                    <input class="easyui-textbox" name="realname" data-options="required:true">
                </td>
            </tr>
            <tr id="tr_password" style="height:40px">
                <td>
                    密码:
                </td>
                <td>
                    <input class="easyui-passwordbox" name="password">
                </td>
            </tr>
            <tr style="height:40px">
                <td>
                    电话:
                </td>
                <td>
                    <input class="easyui-textbox" name="tel">
                </td>
            </tr>
            <tr style="height:40px">
                <td>
                    邮箱:
                </td>
                <td>
                    <input class="easyui-textbox" name="email" data-options="validType:'email'">
                </td>
            </tr>
            <tr style="height:40px">
                <td>
                    部门:
                </td>
                <td>
                    <input class="easyui-combobox" name="dept.id" prompt="请选择"
                           data-options="editable:false,limitToList:true,panelHeight:'auto',valueField:'id',textField:'name',url:'/department/selectAll.do'">
                </td>
            </tr>
            <tr style="height:40px">
                <td>
                    入职日期:
                </td>
                <td>
                    <input class="easyui-datebox" name="hireDate">
                </td>
            </tr>
            <tr style="height:40px">
            <td>
                管理员:
            </td>
            <td>
                <input class="easyui-combobox" name="admin" prompt="请选择"
                       data-options="panelHeight:'auto',
                            valueField: 'id',
                            limitToList: true,
                            editable:false,
                            textField: 'value',
                            data: [{
                                id: '0',
                                value: '否'
                            },{
                                id: '1',
                                value: '是'
                            }]">
            </td>
        </tr>
            <tr style="height:40px">
                <td>
                    角色:
                </td>
                <td>
                    <input class="easyui-combobox" name="role.id" id="roles" prompt="请选择"
                           data-options="multiple:true,editable:false,limitToList:true,panelHeight:'auto',valueField:'id',textField:'name',url:'/role/selectAll.do'">
                </td>
            </tr>
        </table>
    </form>
</div>

</body>
</html>